package service

import (
	"gitee.com/linxing_3/sr-core/domain/service/srvctx"
	"gitee.com/mkwchecking/sr-admin/apps/admin/acl"
)

func (s *SysConfig) GetAsDict(ctx srvctx.IContext, req *acl.SysConfigListReq) (map[string]string, error) {
	list, _, err := s.repo.FindMultiWithEnt(req.PageNum, 1000, req, ctx.DaoScope())
	if err != nil {
		return nil, err
	}

	m := make(map[string]string)
	for _, v := range list {
		m[v.Key] = v.Value
	}

	return m, nil
}
